<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

	<rich:panel id="Edit">
		<h:panelGrid>
			<a4j:form>
				<h:panelGrid columns="2">
					<s:decorate template="/layout/input.xhtml">
						<ui:define name="label">Banco</ui:define>
						<h:inputText value="#{editBankAccount.bankAccount.idBank}" 
						    id="idBanco" 
						    required="true" size="10"
							requiredMessage="Favor introduzca un identificador Banco"
							validatorMessage="El id no puede ser menor a 1 o mayor a 15">
							<f:validateLength minimum="1" maximum="15" />
						</h:inputText>
					</s:decorate>
				
					<s:decorate template="/layout/input.xhtml">
						<ui:define name="label">NroCuenta</ui:define>
						<h:inputText value="#{editBankAccount.editBankAccount.accountNumber}"
							id="NroCuenta" 
							required="true" 
							size="20"
							requiredMessage="Favor introduzca el numero de cuenta bancaria"
							validatorMessage="El numero no puede ser menor a 1 o mayor a 15">
							<f:validateLength minimum="1" maximum="15" />
						</h:inputText>
					</s:decorate>
			</h:panelGrid>
			<h:panelGrid columns="1">
					<s:decorate template="/layout/input.xhtml">
						<ui:define name="label">Referencia</ui:define>
						<h:inputText value="#{editBankAccount.editBankAccount.ref}" 
						    id="Ref" required="true" size="60"
							requiredMessage="Favor introduzca la referencia"
							validatorMessage="El codigo no puede ser menor a 1 o mayor a 80">
							<f:validateLength minimum="1" maximum="80" />
						</h:inputText>
					</s:decorate>
				</h:panelGrid>
                
                <h:panelGrid columns="1">
                	<s:decorate template="/layout/input.xhtml">
						<ui:define name="label">Moneda</ui:define>
						<rich:comboBox converter="#{currencyConverter}"
						    value="#{editBankAccount.editBankAccount.currencyBean}" 
						    id="currencyBean" 
						    required="false" size="30"
							requiredMessage="Favor introduzca la moneda"
							validatorMessage="La moneda no puede ser menor o mayor a 1">
							<f:validateLength minimum="1" maximum="10" />

                            <s:selectItems  value="#{withinHolder.currencyList()}" var="cur" label="#{cur.descrip}">
							</s:selectItems>
						</rich:comboBox>
					</s:decorate>
                </h:panelGrid>
                
				<s:decorate template="/layout/displayButton.xhtml">
					<a4j:commandButton value="Guardar"
						action="#{editBankAccount.dataToEditUpd()}"
						oncomplete="#{rich:component('modalPanel')}.hide()"
						reRender="bankAccountForm, bankAccountGridForm" />
					<rich:spacer width="20px" />
					<h:commandButton value="Cancelar"
						onclick="#{rich:component('modalPanel')}.hide()" />
				</s:decorate>
				</a4j:form>
		</h:panelGrid>
	</rich:panel>
</ui:composition>